package com.byjh.app.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.byjh.app.mapper.QuestionOptionMapper;
import com.byjh.app.domain.QuestionOption;
import com.byjh.app.service.IQuestionOptionService;

/**
 * 题目选项Service业务层处理
 * 
 * @author Dhq
 * @date 2025-01-15
 */
@Service
public class QuestionOptionServiceImpl implements IQuestionOptionService 
{
    @Autowired
    private QuestionOptionMapper questionOptionMapper;

    /**
     * 查询题目选项
     * 
     * @param id 题目选项主键
     * @return 题目选项
     */
    @Override
    public QuestionOption selectQuestionOptionById(Long id)
    {
        return questionOptionMapper.selectQuestionOptionById(id);
    }

    /**
     * 查询题目选项列表
     * 
     * @param questionOption 题目选项
     * @return 题目选项
     */
    @Override
    public List<QuestionOption> selectQuestionOptionList(QuestionOption questionOption)
    {
        return questionOptionMapper.selectQuestionOptionList(questionOption);
    }

    /**
     * 查询题目选项列表
     *
     * @param questionId 题目ID
     * @return 题目选项集合
     */
    @Override
    public List<QuestionOption> selectQuestionOptionListByQuestionId(Long questionId){
        return questionOptionMapper.selectQuestionOptionListByQuestionId(questionId);
    }


    /**
     * 新增题目选项
     * 
     * @param questionOption 题目选项
     * @return 结果
     */
    @Override
    public int insertQuestionOption(QuestionOption questionOption)
    {
        return questionOptionMapper.insertQuestionOption(questionOption);
    }

    /**
     * 修改题目选项
     * 
     * @param questionOption 题目选项
     * @return 结果
     */
    @Override
    public int updateQuestionOption(QuestionOption questionOption)
    {
        return questionOptionMapper.updateQuestionOption(questionOption);
    }

    /**
     * 批量删除题目选项
     * 
     * @param ids 需要删除的题目选项主键
     * @return 结果
     */
    @Override
    public int deleteQuestionOptionByIds(Long[] ids)
    {
        return questionOptionMapper.deleteQuestionOptionByIds(ids);
    }

    /**
     * 删除题目选项信息
     * 
     * @param id 题目选项主键
     * @return 结果
     */
    @Override
    public int deleteQuestionOptionById(Long id)
    {
        return questionOptionMapper.deleteQuestionOptionById(id);
    }
}
